Utilizing reference/id linking in xml wrapper code generation

ABSTRACT

Utilizing reference/identification (ID) linking in extensible markup language (XML) wrapper code generation in a data processing system. A code generator receives a type document and reference/ID constraints document and accesses the reference/ID constraints document to translate between XML structures and object structures.

BACKGROUND OF THE INVENTION

The present disclosure relates to the field of computers, andspecifically to software. Still more specifically, the presentdisclosure relates to efficient generation of computer instructions.

BRIEF SUMMARY OF THE INVENTION

A method for utilizing reference/identification (ID) linking inextensible markup language (XML) wrapper code generation in a dataprocessing system is presented. A code generator receives a typedocument and reference/ID constraints document and accesses thereference/ID constraints document to translate between XML structuresand object structures.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

FIG. 1 depicts an exemplary network in which the present invention maybe implemented;

FIG. 2 is a high-level flow-chart of exemplary steps taken to utilizethe data processing system to generate deserialization code utilizingreference/ID linking according to an embodiment of the presentinvention; and

FIG. 3 is a high-level flow-chart of exemplary steps taken to utilizethe data processing system to generate serialization code utilizingreference/ID linking according to an embodiment of the presentinvention.

DETAILED DESCRIPTION OF THE INVENTION

As will be appreciated by one skilled in the art, the present inventionmay be embodied as a method, system, or computer program product.Accordingly, the present invention may take the form of an entirelyhardware embodiment, an entirely software embodiment (includingfirmware, resident software, micro-code, etc.) or an embodimentcombining software and hardware aspects that may all generally bereferred to herein as a “circuit,” “module” or “system.” Furthermore,the present invention may take the form of a computer program product ona computer-usable storage medium having computer-usable program codeembodied in the medium.

Any suitable computer usable or computer readable medium may beutilized. The computer-usable or computer-readable medium may be, forexample but not limited to, an electronic, magnetic, optical,electromagnetic, infrared, or semiconductor system, apparatus, device,or propagation medium. More specific examples (a non-exhaustive list) ofthe computer-readable medium would include the following: an electricalconnection having one or more wires, a portable computer diskette, ahard disk, a random access memory (RAM), a read-only memory (ROM), anerasable programmable read-only memory (EPROM or Flash memory), anoptical fiber, a portable compact disc read-only memory (CD-ROM), anoptical storage device, a transmission media such as those supportingthe Internet or an intranet, or a magnetic storage device. Note that thecomputer-usable or computer-readable medium could even be paper oranother suitable medium upon which the program is printed, as theprogram can be electronically captured, via, for instance, opticalscanning of the paper or other medium, then compiled, interpreted, orotherwise processed in a suitable manner, if necessary, and then storedin a computer memory. In the context of this document, a computer-usableor computer-readable medium may be any medium that can contain, store,communicate, propagate, or transport the program for use by or inconnection with the instruction execution system, apparatus, or device.The computer-usable medium may include a propagated data signal with thecomputer-usable program code embodied therewith, either in baseband oras part of a carrier wave. The computer usable program code may betransmitted using any appropriate medium, including but not limited tothe Internet, wireline, optical fiber cable, RF, etc.

Computer program code for carrying out operations of the presentinvention may be written in an object oriented programming language suchas Java.®. (Java is a trademark or registered trademark of SunMicrosystems, Inc. in the United States and other countries), Smalltalk,C++ or the like. However, the computer program code for carrying outoperations of the present invention may also be written in conventionalprocedural programming languages, such as the “C” programming languageor similar programming languages. While such programs are exemplary innature, any language that complies with Turing Completeness (i.e., is amachine capable of executing instructions, calculations and similarprogrammable processes) may utilized by the present invention. Theprogram code may execute entirely on the user's computer, partly on theuser's computer, as a stand-alone software package, partly on the user'scomputer and partly on a remote computer or entirely on the remotecomputer or server. In the latter scenario, the remote computer may beconnected to the user's computer through a local area network (LAN) or awide area network (WAN), or the connection may be made to an externalcomputer (for example, through the Internet using an Internet ServiceProvider).

The present invention is described below with reference to flowchartillustrations and/or block diagrams of methods, apparatuses (systems)and computer program products according to embodiments of the invention.It will be understood that each block of the flowchart illustrationsand/or block diagrams, and combinations of blocks in the flowchartillustrations and/or block diagrams, can be implemented by computerprogram instructions. These computer program instructions may beprovided to a processor of a general purpose computer, special purposecomputer, or other programmable data processing apparatus to produce amachine, such that the instructions, which execute via the processor ofthe computer or other programmable data processing apparatus, createmeans for implementing the functions/acts specified in the flowchartand/or block diagram block or blocks.

These computer program instructions may also be stored in acomputer-readable memory that can direct a computer or otherprogrammable data processing apparatus to function in a particularmanner, such that the instructions stored in the computer-readablememory produce an article of manufacture including instruction meanswhich implement the function/act specified in the flowchart and/or blockdiagram block or blocks.

The computer program instructions may also be loaded onto a computer orother programmable data processing apparatus to cause a series ofoperational steps to be performed on the computer or other programmableapparatus to produce a computer implemented process such that theinstructions which execute on the computer or other programmableapparatus provide steps for implementing the functions/acts specified inthe flowchart and/or block diagram block or blocks.

With reference now to FIG. 1, there is depicted a block diagram of anexemplary computer 100, with which the present invention may beutilized. Computer 100 includes a processor unit 104 that is coupled toa system bus 106. A video adapter 108, which drives/supports a display110, is also coupled to system bus 106. System bus 106 is coupled via abus bridge 112 to an Input/Output (I/O) bus 114. An I/O interface 116 iscoupled to I/O bus 114. I/O interface 116 affords communication withvarious I/O devices, including a keyboard 118, a mouse 120, a CompactDisk-Read Only Memory (CD-ROM) drive 122, and a flash memory drive 126.The format of the ports connected to I/O interface 116 may be any knownto those skilled in the art of computer architecture, including but notlimited to Universal Serial Bus (USB) ports.

Computer 100 is able to communicate with a server 150 via a network 128using a network interface 130, which is coupled to system bus 106.Network 128 may be an external network such as the Internet, or aninternal network such as an Ethernet or a Virtual Private Network (VPN).

A hard drive interface 132 is also coupled to system bus 106. Hard driveinterface 132 interfaces with a hard drive 134. In one embodiment, harddrive 134 populates a system memory 136, which is also coupled to systembus 106. System memory 136 is defined as a lowest level of volatilememory in computer 100. This volatile memory may include additionalhigher levels of volatile memory (not shown), including, but not limitedto, cache memory, registers, and buffers. Code that populates systemmemory 136 includes an operating system (OS) 138 and applicationprograms 144.

OS 138 includes a shell 140, for providing transparent user access toresources such as application programs 144. Generally, shell 140 (as itis called in UNIX.®.—UNIX is a registered trademark of The Open Group inthe United States and other countries) is a program that provides aninterpreter and an interface between the user and the operating system.Shell 140 provides a system prompt, interprets commands entered bykeyboard 118, mouse 120, or other user input media, and sends theinterpreted command(s) to the appropriate lower levels of the operatingsystem (e.g., kernel 142) for processing. As depicted, OS 138 alsoincludes kernel 142, which includes lower levels of functionality for OS138. Kernel 142 provides essential services required by other parts ofOS 138 and application programs 144. The services provided by kernel 142include memory management, process and task management, disk management,and I/O device management.

Application programs 144 include a browser 146. Browser 146 includesprogram modules and instructions enabling a World Wide Web (WWW) client(i.e., computer 100) to send and receive network messages to theInternet. Computer 100 may utilize HyperText Transfer Protocol (HTTP)messaging to enable communication with server 150. Application programs144 in system memory 136 also includes a code generator 148, typedocument 156, reference/ID constraints document 152, and directedconstraint graph 154. Code generator 148 performs the functionsdescribed below in FIGS. 2-3.

The hardware elements depicted in computer 100 are not intended to beexhaustive, but rather represent and/or highlight certain componentsthat may be utilized to practice the present invention. For instance,computer 100 may include alternate memory storage devices such asmagnetic cassettes, Digital Versatile Disks (DVDs), Bernoullicartridges, and the like. These and other variations are intended to bewithin the spirit and scope of the present invention.

FIG. 2 is a high-level logical flowchart illustrating an exemplarymethod for implementing deserialization code generation utilizingreference/ID linking according to an embodiment of the presentinvention. The process begins at step 200 and proceeds to step 202,which illustrates code generator 148 receiving a type document 156(FIG. 1) that includes XML code and reference/ID constraints document152 (FIG. 1) that specifies the reference/ID constraints of the XML codein type document 156. The process continues to step 204, whichillustrates code generator 148 (FIG. 1) creating a directed constraintgraph 154 (FIG. 1).

The process continues to step 206, which illustrates code generator 148(FIG. 1) generating a first set of deserialization code for XMLstructures that are not in directed constraint graph 154 (FIG. 1). Theprocess proceeds to step 208, which shows code generator 148 (FIG. 1)creating a second set of deserialization code for at least one leaf XMLstructure in the directed constraint graph. According to an embodimentof the present invention, a leaf XML structure is an XML structure thatdoes not reference any other XML structure in the directed constraintgraph.

The process continues to step 210, which depicts code generator 148(FIG. 1) generating a third set of deserialization code for at least onenext highest XML structure in the directed constraint graph. Accordingto an embodiment of the present invention, the next highest XMLstructure is an XML structure that is not a leaf XML structure or a rootXML structure in the directed constraint graph.

The process proceeds to step 212, which illustrates code generator 148(FIG. 1) generating a fourth set of deserialization code for the rootXML structure in the directed constraint graph. According to anembodiment of the present invention, a root XML structure is a structurethat does not referenced by any other XML structure. The processcontinues to step 214, which shows code generator 148 (FIG. 1) storingat least one intermediate object structure in at least one temporaryhash table. The intermediate object structures will be stored intemporary hash tables for lookup by parent object structures in thedirected constraint graph.

The process proceeds to step 216, which illustrates code generator 148(FIG. 1) creating cleanup functions within the deserialization code,with removes all temporary hash tables used in the objectdeserialization. The process continues to step 217, which shows codegenerator 148 (FIG. 1) outputting the generated deserialization code.The process ends, as shown in step 218.

FIG. 3 is a high-level logical flowchart illustrating an exemplarymethod for implementing serialization code generation utilizingreference/ID linking according to an embodiment of the presentinvention. The process begins at step 300 and continues to step 302,which illustrates code generator 148 (FIG. 1) receiving type document156 (FIG. 1) and reference/ID constraints document 152 (FIG. 1). Theprocess continues to step 304, which illustrates code generator 148(FIG. 1) generating a first serialization code for at least one childobject structure for each object structure to be serialized and creatingserialization code for each element in the constrains graph. Onlyidentifying attributes of the child object structure into the parentobject structure's XML structure. The process proceeds to step 306,which illustrates code generator 148 (FIG. 1) creating a secondserialization code for at least one non-referenced child objectstructure.

The process continues to step 308, which illustrates code generator 148(FIG. 1) determining if at least one child object does not exits in anative definition location. If not, the process continues to step 314,which illustrates code generator 148 (FIG. 1) determining if the processshould end. If not, the process returns to step 304. If so, codegenerator 148 outputs the generated serialization code, as illustratedin step 316 and the process ends, as shown in step 318.

Returning to step 308, if code generator 148 (FIG. 1) determines that atleast one child object does not exists in a native definition location,the process continues to steps 310 and 312, which illustrate codegenerator 148 b (FIG. 1) generating an error handling code and/orplacing the child object in the native definition location. The processcontinues to step 314.

Note that the flowchart and block diagrams in the figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof code, which comprises one or more executable instructions forimplementing the specified logical function(s). It should also be notedthat, in some alternative implementations, the functions noted in theblock may occur out of the order noted in the figures. For example, twoblocks shown in succession may, in fact, be executed substantiallyconcurrently, or the blocks may sometimes be executed in the reverseorder, depending upon the functionality involved. It will also be notedthat each block of the block diagrams and/or flowchart illustration, andcombinations of blocks in the block diagrams and/or flowchartillustration, can be implemented by special purpose hardware-basedsystems that perform the specified functions or acts, or combinations ofspecial purpose hardware and computer instructions.

Note further that while the present invention has been described inreference to references/ID constraints in XML code, the above describedinvention may similarly be utilized to reference any file, includingdatabase files, etc.

The terminology used herein is for the purpose of describing particularembodiments only and is not intended to be limiting of the invention. Asused herein, the singular forms “a”, “an” and “the” are intended toinclude the plural forms as well, unless the context clearly indicatesotherwise. It will be further understood that the terms “comprises”and/or “comprising,” when used in this specification, specify thepresence of stated features, integers, steps, operations, elements,and/or components, but do not preclude the presence or addition of oneor more other features, integers, steps, operations, elements,components, and/or groups thereof

The corresponding structures, materials, acts, and equivalents of allmeans or step plus function elements in the claims below are intended toinclude any structure, material, or act for performing the function incombination with other claimed elements as specifically claimed. Thedescription of the present invention has been presented for purposes ofillustration and description, but is not intended to be exhaustive orlimited to the invention in the form disclosed. Many modifications andvariations will be apparent to those of ordinary skill in the artwithout departing from the scope and spirit of the invention. Theembodiment was chosen and described in order to best explain theprinciples of the invention and the practical application, and to enableothers of ordinary skill in the art to understand the invention forvarious embodiments with various modifications as are suited to theparticular use contemplated.

Having thus described the invention of the present application in detailand by reference to embodiments thereof, it will be apparent thatmodifications and variations are possible without departing from thescope of the invention defined in the appended claims.

1-20. (canceled)
 21. A computer-implemented method, comprising:receiving a type document including extensible markup language (XML)code; receiving a reference/identification (ID) constraints document;translating, by a code generator and using the reference/ID constraintsdocument, between an XML structure within the XML code and an objectstructure.
 22. The method of claim 21, wherein the reference/IDconstraints document specifies reference/ID constraints of the XML codewith the type document.
 23. The method of claim 21, further comprisingcreating a directed constraint graph using the reference/ID constraintsdocument.
 24. The method of claim 23, further comprising generating, foran XML structure not in the directed constraint graph, a first set ofdeserialization code.
 25. The method of claim 24, further comprisinggenerating, for a leaf XML structure within the directed constraintgraph, a second set of deserialization code.
 26. The method of claim 25,further comprising generating, for a higher XML structure within thedirected constraint graph, a third set of deserialization code, whereinthe higher XML structure is a next highest structure in the directedconstraint graph than the leaf XML structure.
 27. A computer hardwaresystem, comprising: a hardware processor including a code generator,wherein the hardware processor is configured to initiate and/or perform:receiving a type document including extensible markup language (XML)code; receiving a reference/identification (ID) constraints document;translating, by the code generator and using the reference/IDconstraints document, between an XML structure within the XML code andan object structure.
 28. The system of claim 27, wherein thereference/ID constraints document specifies reference/ID constraints ofthe XML code with the type document.
 29. The system of claim 27, whereinthe hardware processor is further configured to initiate and/or performcreating a directed constraint graph using the reference/ID constraintsdocument.
 30. The system of claim 29, wherein the hardware processor isfurther configured to initiate and/or perform generating, for an XMLstructure not in the directed constraint graph, a first set ofdeserialization code.
 31. The system of claim 30, wherein the hardwareprocessor is further configured to initiate and/or perform generating,for a leaf XML structure within the directed constraint graph, a secondset of deserialization code.
 32. The system of claim 31, wherein thehardware processor is further configured to initiate and/or performgenerating, for a higher XML structure within the directed constraintgraph, a third set of deserialization code, wherein the higher XMLstructure is a next highest structure in the directed constraint graphthan the leaf XML structure.
 33. A computer program product, comprising:a computer usable storage device having stored therein computer usableprogram code, which when executed by a computer hardware system, causesthe computer hardware system to perform: receiving a type documentincluding extensible markup language (XML) code; receiving areference/identification (ID) constraints document; translating, by acode generator and using the reference/ID constraints document, betweenan XML structure within the XML code and an object structure.
 34. Thecomputer program product of claim 33, wherein the reference/IDconstraints document specifies reference/ID constraints of the XML codewith the type document.
 35. The computer program product of claim 33,wherein the computer usable program code further causes the computerhardware system to perform creating a directed constraint graph usingthe reference/ID constraints document.
 36. The computer program productof claim 35, wherein the computer usable program code further causes thecomputer hardware system to perform generating, for an XML structure notin the directed constraint graph, a first set of deserialization code.37. The computer program product of claim 36, wherein the computerusable program code further causes the computer hardware system toperform generating, for a leaf XML structure within the directedconstraint graph, a second set of deserialization code.
 38. The computerprogram product of claim 37, wherein the computer usable program codefurther causes the computer hardware system to perform generating, for ahigher XML structure within the directed constraint graph, a third setof deserialization code, wherein the higher XML structure is a nexthighest structure in the directed constraint graph than the leaf XMLstructure.